home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Tcl / Modes / HTML and CSS Modes / htmlMenuDefinition.tcl < prev    next >
Encoding:
Text File  |  2001-01-13  |  11.0 KB  |  230 lines

  1. ## -*-Tcl-*-
  2.  # ###################################################################
  3.  #  HTML mode - tools for editing HTML documents
  4.  # 
  5.  #  FILE: "htmlMenuDefinition.tcl"
  6.  #                                    created: 99-07-15 20.03.23 
  7.  #                                last update: 01-01-13 10.23.03 
  8.  #  Author: Johan Linde
  9.  #  E-mail: <alpha_www_tools@go.to>
  10.  #     www: <http://go.to/alpha_www_tools>
  11.  #  
  12.  # Version: 3.0
  13.  # 
  14.  # Copyright 1996-2001 by Johan Linde
  15.  #  
  16.  # This program is free software; you can redistribute it and/or modify
  17.  # it under the terms of the GNU General Public License as published by
  18.  # the Free Software Foundation; either version 2 of the License, or
  19.  # (at your option) any later version.
  20.  # 
  21.  # This program is distributed in the hope that it will be useful,
  22.  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  # GNU General Public License for more details.
  25.  # 
  26.  # You should have received a copy of the GNU General Public License
  27.  # along with this program; if not, write to the Free Software
  28.  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  # 
  30.  # ###################################################################
  31.  ##
  32.  
  33. #===============================================================================
  34. # This file contains the definition of the HTML menus.
  35. # For each submenu a list html<menu>Sub is defined where each item has the following format:
  36. # <default key binding> <menu item> <optionally the element related to the menu item>
  37. # The optional element is used by CSS mode to define key bindings.
  38. #===============================================================================
  39.  
  40. proc htmlMenuDefinition.tcl {} {}
  41.  
  42. set htmlHTMLSub {{"<I/t" "Help"} {"<U<O/N" "New Document…"} {"<U<O<I/N" "New with Content…"}}
  43.  
  44. set htmlBrowsersSub {{"<U<O/S" "Send File to Browser"} {"<U<O/U" "Send URL to Browser"} "(-" {"" "Add…"} {"" "Remove…"}}
  45.  
  46. if {![alpha::package vsatisfies ${alpha::tclversion} 7.4b8]} {
  47. set htmlPreferencesSub {{"" "General…"} "(-" {"" "Attributes Globally…"} {"<B/m" "Use Attributes…"} {"" "Indentation…"} 
  48.     {"" "Element Layout…"} {"" "Optional Closing Tags…"} "(-" {"" "Home Pages…"} {"" "Key Bindings…"}
  49.     {"" "Coloring…"} {"" "Checking Links…"} {"" "Word Wrapping…"} "(-"
  50.     {"" "Content Types…"} {"" "Media Descriptors…"} {"" "Link Types…"}}
  51. } else {
  52. set htmlPreferencesSub {{"" "General…"} "(-" {"" "Attributes Globally…"} {"<B/m" "Use Attributes…"} {"" "Indentation…"} 
  53.     {"" "Element Layout…"} {"" "Optional Closing Tags…"} "(-" {"" "Home Pages…"} {"" "Key Bindings…"}
  54.     {"" "Coloring…"} {"" "Electrics…"} {"" "Checking Links…"} {"" "Word Wrapping…"} "(-"
  55.     {"" "Content Types…"} {"" "Media Descriptors…"} {"" "Link Types…"}}
  56. }
  57.  
  58. set htmlStyleSub {{"<B<O<U/S" Style STYLE} {"<B/b" Span SPAN}}
  59.     
  60. set htmlHeadersSub {{"<B<O/1" "Header1/H1 no attr" H1}
  61.         {"<B<O/2" "Header2/H2 no attr" H2}
  62.         {"<B<O/3" "Header3/H3 no attr" H3}
  63.         {"<B<O/4" "Header4/H4 no attr" H4}
  64.         {"<B<O/5" "Header5/H5 no attr" H5}
  65.         {"<B<O/6" "Header6/H6 no attr" H6}}
  66.     
  67. set htmlBlocksSub {{"" "Insert Line Breaks"} {"" "Remove Line Breaks"}
  68.         {"" "Insert Paragraphs"} "(-"
  69.         {"<U/b" "Paragraph/P no attr" P}
  70.         {"<U<O/b" "Division" DIV}
  71.         {"<B<O/Q" "Block Quote" BLOCKQUOTE} {"<B<O/S" "Address" ADDRESS}
  72.         {"<B<O/C" "Center" CENTER} {"<B<O/P" "Preformatted" PRE}
  73.         {"<B<O/X" "Multi Column" MULTICOL}
  74.         {"<B<O/Z" "Spacing" SPACER} {"" "Direction Override" BDO} {"<B<O/u" "Inserted Text" INS}
  75.         {"<B<O/v" "Deleted Text" DEL} "(-"
  76.         {"<O/b" "Line Break/BR no attr" BR}
  77.         {"<B<O/H" "Horizontal Rule/HR no attr" HR}
  78.         {"<B<O/B" "No Line Break" NOBR} {"<B<O/W" "Word Break" WBR}}
  79.     
  80. set htmlStylesSub {{"<B<I/F" Font FONT} {"<B<I/N" Basefont BASEFONT}
  81.         {"<B<I/M" Marquee MARQUEE} "(-" {"<B<I/B" Bold B}
  82.         {"<B<I/I" Italic I} {"<B<I/-" "Strike out" STRIKE} {"<B<I<O/-" Underlined U}
  83.         {"<B<I/." Superscript SUP} {"<B<I/," Subscript SUB} {"<B<I<O/." Bigger BIG}
  84.         {"<B<I<O/," Smaller SMALL} {"<B<I/T" Typewriter TT} {"<B<I/Z" Blinking BLINK}
  85.         "(-" {"<B<I/Q" Quotation Q} {"<B<I/A" Abbreviation ABBR} {"<B<I/Y" Acronym ACRONYM} 
  86.         {"<B<I/E" Emphasis EM} {"<B<I/S" Strong STRONG} {"<B<I/D" Definition DFN}
  87.         {"<B<I/C" Code CODE} {"<B<I/V" Variable VAR}    {"<B<I/X" Citation CITE} 
  88.         {"<B<I/K" Keyboard KBD} {"<B<I/P" Sample SAMP}}
  89.         
  90. set htmlLinksSub {{"<B<O/A" "Link or Anchor" A} {"<B<O/I" Image IMG}
  91.         {"<B<O/T" Object OBJECT} {"" Sound BGSOUND}}
  92.     
  93. set htmlPlug-insSub {{"<B<O/E" General EMBED} {"<B<O/N" "No Embed" NOEMBED}}
  94.     
  95. set htmlListsSub {{"" "Make List…"} "(-" {"<B<O/U" "Unordered List/UL no attr" UL}
  96.         {"<B<O/O" "Ordered List/OL no attr" OL}
  97.         {"<B<O/D" "Directory" DIR}
  98.         {"<B<O/M" "Menu" MENU} {"<B<I/L" "List Item" LI} "(-"
  99.         {"<B<U<O/D" "Definition List" DL} {"<B<I<O/L" "Definition Entry"}}
  100.     
  101. set htmlFormsSub {{"<B<U/F" Form FORM} {"<B<U/D" "Field Set" FIELDSET} {"<B<U/L" Legend LEGEND}
  102.         {"<B<U/E" Label LABEL} "(-" {"<B<U/T" Text INPUT}
  103.         {"<B<U/B" Checkbox  INPUT} {"<B<U/N" "Input Button" INPUT}
  104.         {"<B<U/R" Radio INPUT} {"<B<U/S" Submit INPUT}
  105.         {"<B<U/C" Reset INPUT} {"<B<U/P" Password INPUT}
  106.         {"<B<U/H" Hidden INPUT} {"<B<U/I" Image INPUT}
  107.         {"<B<U/U" "File Upload" INPUT}
  108.         "(-" {"<B<U<I/U" Button BUTTON} {"<B<U<I/S" Select SELECT} {"<B<U/G" "Option Group" OPTGROUP}
  109.         {"<B<U/O" Option OPTION} {"<B<U<I/T" Textarea TEXTAREA} {"" "Key Generator" KEYGEN}}
  110.     
  111. set htmlTablesSub {{"" "Table Template…"} {"" "Tabs to Rows…"} {"" "Rows to Tabs"} {"" "Import Table…"} "(-"
  112.         {"<U<O/T" Table TABLE} {"<U<O/R" "Row/TR no attr" TR}
  113.         {"<U<O/H" "Header/TH no attr" TH} {"<U<O/D" "Cell/TD no attr" TD}
  114.         {"<U<O/C" Caption CAPTION} "(-"
  115.         {"<B<U<O/H" Head THEAD} {"<B<U<O/B" Body TBODY} {"<B<U<O/F" Foot TFOOT}
  116.         "(-" {"<B<U<O/G" "Column Group" COLGROUP} {"<B<U<O/C" "Column" COL}}
  117.     
  118. set htmlFramesSub {{"<B<U<I/F" "New Doc. with Frames…"} "(-" {"<B<U<I/O" Frameset FRAMESET}
  119.         {"<B<U<I/R" Frame FRAME} {"" "Inline Frame" IFRAME}
  120.         {"<B<U<I/N" "No Frames" NOFRAMES}}
  121.     
  122. set htmlImageSub {{"" "Convert NCSA Map…"} {"" "Convert CERN Map…"} "(-" {"<B<U/M" Map MAP} 
  123.         {"<B<U/A" Area AREA}}
  124.     
  125. set htmlJavaSub {{"<U<I<O/J" Applet APPLET} {"<U<I<O/P" Parameter PARAM}
  126.         "(-" {"<U<I<O/S" Script SCRIPT} {"<B<U<O/N" "No Script" NOSCRIPT} {"" Server SERVER}}
  127.     
  128. set htmlLayersSub {{"" Layer LAYER} {"" "Inline Layer" ILAYER} {"" "No Layer" NOLAYER}}
  129.     
  130. set htmlOtherSub {{"<B<U<I/C" Comment} {"<B<U<I/B" Base BASE}
  131.         {"<B<U<I/I" Isindex ISINDEX}
  132.         {"<B<U<I/L" Link LINK} {"<B<U<I/M" Meta META} {"" "Comment Line"}}
  133.  
  134. # Variables defining the HTML Utilities menu
  135.         
  136. set htmlUtilitiesSub {{"" "Move Files…"} {"" "Rename File…"} {"" "Rename Folder…"} 
  137.     "(-" {"" "Last Modified…"} {"" "Document Type…"} {"" "Document Size"} 
  138.     {"" "Document Index…"}}
  139.  
  140. set htmlEditingSub {{"<O/B" "Select Container"}
  141.     {"<U<O/B" "Select in Container"} {"<O<I/B" "Select Tag"}
  142.     {"<B/e" "Untag"} {"<B<I/e" "Untag and Select"} {"<B/f" "Remove Opening"}
  143.     {"<B/g" "Edit Tag…"} {"<B/h" "Change Choice"}
  144.     {"<B/i" "Reveal Color"} {"<B/j" "Insert Attributes"} {"" "Quote All Attributes"}
  145.     {"" "Tags to Uppercase"} {"" "Tags to Lowercase"} {"" "Remove Tags"}}
  146.  
  147. set htmlValidateSub {{"" "Find Unbalanced Tags"} {"" "Check Tags"} {"" "Check Tags and Attributes"}}
  148.  
  149. set htmlCharacterSub {{"" "åäö -> HTML"} {"" "HTML -> åäö"}}
  150.  
  151. set htmlColorsSub {{"" "New Color Set…"} {"" "Delete Color Set…"} {"" "Edit Color Set…"}}
  152.  
  153. set htmlURLsSub {{"" "Clean Up…"} {"" "Clear"} {"" "Import…"} {"" "Export…"} {"" "Add Folder…"}
  154.     {"" "Add Selection"} {"" "Add Clipboard"}}
  155.  
  156. set htmlWindowsSub {{"" "Clean Up…"} {"" "Clear"}}
  157.  
  158. set htmlCheckSub {{"" "Check Window"} {"" "Check Home Page…"} {"" "Check Folder…"} {"" "Check File…"}
  159.     {"" "Check Remote Links"} "(-" {"" "Use Big Brother"}}
  160.  
  161. set htmlIncludesSub {{"" "Insert Include Tags…"} "(-" {"" "Update Window"} {"" "Update Home Page…"}
  162.     {"" "Update Folder…"} {"" "Update File…"}}
  163.  
  164. set htmlHomeSub {{"" Open…} {"<U<O/V" "Paste URL"} {"<U<O<I/V" "Paste Include Tags"} {"" "Refresh Windows"}}
  165.  
  166. set htmlFTPSub {{"" "Save to FTP Server"} {"" "Forget Passwords"} {"" "Upload Home Page…"} {"" "NetFinder Mirror Files…"}}
  167.  
  168. set htmlFormattingSub {{"<O/I" "Reformat Paragraph"} {"<O<I/I" "Reformat Document"} {"" "No Formatting"} {"" "C Style Formatting"}}
  169.  
  170. set htmlExtendSub {{"" "New Element…"} {"" "Edit Element…"} {"" "Remove Additions…"}}
  171.  
  172.  
  173. set htmlSubMenus [list HTML Browsers Preferences {Style Sheets} Headers {Blocks and Dividers} \
  174.   Styles Links Plug-ins Lists Forms Tables Frames {Image Maps} {Java and JavaScript} Layers Other]
  175.  
  176. set htmlUtilSubMenus [list Utilities Editing Validate {Character Translation} Colors URLs Windows \
  177.   {Check Links} Includes FTP Formatting {Home Page Windows} Extend]
  178.  
  179.  
  180. # Index of which menu is the first with HTML elements.
  181. set htmlStartElements 3
  182.  
  183. foreach __tmp [lrange $htmlSubMenus 1 end] {
  184.     menu::buildProc $__tmp "html::BuildSubMenuProc [list $__tmp] html::MenuItem"
  185. }
  186.  
  187. foreach __tmp [lrange $htmlUtilSubMenus 1 end] {
  188.     menu::buildProc $__tmp "html::BuildSubMenuProc [list $__tmp] html::UtilsMenuItem"
  189. }
  190.  
  191. menu::buildProc "Character Entities" html::BuildCharsMenu
  192. menu::buildProc "Small Chars" {html::BuildSubCharsMenu html::SmallCharsMenu "Small Chars" ""}
  193. menu::buildProc "Capital Chars" {html::BuildSubCharsMenu html::CapitalCharsMenu "Capital Chars" ""}
  194. menu::buildProc "Other Chars 1" {html::BuildSubCharsMenu html::OtherChars1Menu "Other Chars 1" ""}
  195. menu::buildProc "Other Chars 2" {html::BuildSubCharsMenu html::OtherChars2Menu "Other Chars 2" ""}
  196. menu::buildProc htmlMenu html::BuildMenuProc
  197. menu::buildProc htmlUtilsMenu html::BuildUtilsMenuProc
  198. menu::buildProc Custom html::BuildCustomMenu
  199.  
  200. hook::register menuBuild html::BlocksDisable "Blocks and Dividers"
  201. hook::register menuBuild html::StylesDisable Styles
  202. hook::register menuBuild html::LinksDisable Links
  203. hook::register menuBuild html::ListsDisable Lists
  204. hook::register menuBuild html::FormsDisable Forms
  205. hook::register menuBuild html::FramesDisable Frames
  206. hook::register menuBuild html::JavaDisable "Java and JavaScript"
  207. hook::register menuBuild html::OtherDisable Other
  208.  
  209. hook::register menuBuild html::BuildMenuExtra htmlMenu
  210. hook::register menuBuild html::BuildUtilsMenuExtra htmlUtilsMenu
  211. hook::register menuBuild html::MarkBrowsersMenu Browsers
  212. hook::register menuBuild html::CharacterMenuExtra "Character Translation"
  213. hook::register menuBuild html::CheckMenuExtra "Check Links"
  214. hook::register menuBuild html::URLsMenuExtra URLs
  215. hook::register menuBuild html::WindowsMenuExtra Windows
  216. hook::register menuBuild html::ColorsMenuExtra Colors
  217. hook::register menuBuild html::FtpMenuExtra FTP
  218. hook::register menuBuild html::EnableExtend Extend
  219.  
  220. set html::DisabledExtensions [list "Blocks and Dividers/Multi Column" \
  221.   "Blocks and Dividers/Spacing" "Blocks and Dividers/No Line Break" "Blocks and Dividers/Word Break" \
  222.   "Styles/Marquee" "Styles/Blinking" "Links/Sound" {$htmlMenu/Plug-ins} \
  223.   "Forms/Key Generator" "Java and JavaScript/Server" {$htmlMenu/Layers}]
  224.  
  225. set html::DisabledDeprecated ${html::DisabledExtensions}
  226. lappend html::DisabledDeprecated "Java and JavaScript/Applet" "Styles/Font" "Styles/Basefont" \
  227.   "Blocks and Dividers/Center" "Lists/Directory" "Lists/Menu" "Other/Isindex" \
  228.   "Styles/Strike out" "Styles/Underlined"
  229.